#include <iostream> 
using namespace std;

class Base{
	public:
		Base(){
			cout<<"Base.Con"<<endl;
		}
		virtual void Method()=0;
		virtual ~Base(){
			cout<<"Base.Des"<<endl;
		}
};

class Proxy:public Base{
	private:
		Base *pb;
	public:
		Proxy(Base *_pb){
			pb=_pb;
		}
		void Method(){
			pb->Method();
		}
		~Proxy(){
			delete pb;
			cout<<"pb.Des"<<endl;
		}
};

class Wine:public Base{
	public:
		void Method(){
			cout<<"Wine"<<endl;
		}
		~Wine(){
			cout<<"Wine.Des"<<endl;
		}
		
};

class Phone:public Base{
	public:
		void Method(){
			cout<<"Phone"<<endl;
		}
		~Phone(){
			cout<<"Phone.Des"<<endl;
		}
};

int main(void){
	Proxy *pP=new Proxy(new Phone());
	pP->Method();
	delete pP;
	return 0;
}
